<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@taglib uri="/WEB-INF/tld/pageutil.tld" prefix="pu"%>
<%@taglib uri="/WEB-INF/tld/pageable.tld" prefix="pageable"%>
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt-rt"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@	page import="com.yaodian100.core.common.utils.ServerValue"%>
<c-rt:set var="midContextPath" value='<%=ServerValue.getMidContextPath()%>'/>
<c-rt:set var="tp" value="${pu:pageableTag('tpp', 10, 10)}"/>
<c-rt:set var="hql">
from BonusTransfer where memberId = ? 
</c-rt:set>

<c-rt:set var="params" value="${pu:addToList('paras', param.memberId)}"/>
<c-rt:set var="hql">${hql} order by createDate DESC, id DESC</c-rt:set>
<c-rt:set var="bonusTransfers" value="${pu:queryByHql(hql, params, tp)}"/>
<s:actionerror />
<s:actionmessage />
<s:fielderror />
<table class="tb-1" width="100%">
	<thead>
		<tr>
			<th>使用日期</th>
			<th>摘要</th>
			<th>返还积分</th>
			<th>使用积分</th>
		</tr>
	</thead>
	<tbody>
		<c-rt:set var="row_count" value='0'/>
		<c-rt:forEach items="${bonusTransfers}" var="bonusTransfer" varStatus="rows_index">
			<c-rt:if test ="${bonusTransfer.refoundBonus > 0}">
				<tr class="${row_count % 2 == 0 ? 'bg-yl' : ''}">
				<td><fmt-rt:formatDate value="${bonusTransfer.createDate}" pattern="yyyy-MM-dd"/></td>
          		<td><p>商品退货/取消完成，归还积分。 <c-rt:if test="${not empty bonusTransfer.orderId}"> 订单编号：${bonusTransfer.orderId}</c-rt:if></p></td>
          		<td>+${bonusTransfer.refoundBonus}</td>
          		<td>&nbsp;</td>
          		</tr>
          		<c-rt:set var="row_count" value="${row_count + 1}"/>
          	</c-rt:if>
          	<c-rt:if test ="${bonusTransfer.useBonus > 0}">
          		<tr class="${row_count % 2 == 0 ? 'bg-yl' : ''}">
          		<td><fmt-rt:formatDate value="${bonusTransfer.createDate}" pattern="yyyy-MM-dd"/></td>
          		<td><p>折抵订单 <c-rt:if test="${not empty bonusTransfer.orderId}"> 订单编号：${bonusTransfer.orderId}</c-rt:if></p></td> 
          		<td>&nbsp;</td>
          		<td class="txt-rd">-${bonusTransfer.useBonus}</td>
          		</tr>
          		<c-rt:set var="row_count" value="${row_count + 1}"/>
          	</c-rt:if>
		</c-rt:forEach>
	</tbody>
</table>
<pageable:Pageable url="${midContextPath}/member/searchBonusTransfer.do" parameter="AJAX=true&refreshZone=tabs-12" escapeparams="AJAX,refreshZone" formname="NewBonusTransferForm" key="tpp"></pageable:Pageable>
